﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using VideoClubGorbea.Model;

namespace VideoClubGorbea.Model
{
    public class DummyDataInitializer<T> : DropCreateDatabaseAlways<T> where T : VideoClubGorbeaContext
    {
        protected override void Seed(T context)
        {
            context.Movies.Add(new Movie()
            {
                Actors = new List<Person>()
                {
                     new Person()
                     {
                          Name = "Daniel Sam"
                     },
                     new Person()
                     {
                          Name = "Maestro Miyagui" 
                     }
                },
                ReleaseDate = new DateTime(1984, 01, 03),
                Director = new Person() { Name = "John G. Avildsen" },
                Price = 5.5,
                Productor = new Person() { Name = "Bill Murray" },
                Title = "karate Kid",
                Slogan = "“Only the 'Old One' could teach him the secrets of the masters.”",
                OverView = "Hassled by the school bullies, Daniel LaRusso has his share of adolescent woes. Luckily, his apartment building houses a resident martial arts master: Kesuke Miyagi, who agrees to train Daniel ... and ends up teaching him much more than self-defense. Armed with newfound confidence, skill and wisdom, Daniel ultimately faces off against his tormentors in this hugely popular classic underdog tale.",
                Posters = new List<Image>() { new Image(){ Url= @"http://cf1.imgobject.com/posters/5ad/4c96f3b15e73d63a760005ad/the-karate-kid-cover.jpg"}},
                Rating = 3.5
            });
            context.Movies.Add(new Movie()
            {
                Actors = new List<Person>()
                {
                     new Actor()
                     {
                          Name = "Richard" 
                     }
                },
                ReleaseDate = new DateTime(1994, 01, 03),
                Director = new Person() { Name = "John G. Avildsen" },
                Price = 5.5,
                Productor = new Person() { Name = "Peter Hyams" },
                Title = "TimeCop",
                Slogan = "“They killed his wife ten years ago. There's still time to save her.”",
                OverView = "An officer for a security agency that regulates time travel, must fend for his life against a shady politician who has a tie to his past.",
                Rating = 6.5,
                Posters = new List<Image>() { new Image(){ Url= @"http://cf1.imgobject.com/posters/5f9/4caa05b55e73d643ef0005f9/timecop-cover.jpg"} }
            });
            context.Movies.Add(new Movie()
            {
                ReleaseDate = new DateTime(1984, 01, 03),
                Director = new Person() { Name = "	Roger Allers" },
                Price = 5.5,
                Productor = new Person() { Name = "Rob Minkoff" },
                Title = "The Lion King",
                Slogan = "“Life's greatest adventure is finding your place in the Circle of Life.”",
                OverView = "A young lion cub named Simba can't wait to be king. But his uncle craves the title for himself and will stop at nothing -- even killing his own brother -- to get it.",
                Posters = new List<Image>() { new Image(){ Url= @"http://cf1.imgobject.com/posters/201/4e50d4205e73d66b02000201/the-lion-king-cover.jpg" }}
            });
            context.SaveChanges();
        }

    }
}
